#ifndef STATUSSERVER_H
#define STATUSSERVER_H

#include "SingleClass.h"
#include <grpc++/grpc++.h>
#include "../rpc/message.grpc.pb.h"
#include "../rpc/message.pb.h"
#include <string>

struct chat_server_address{
    std::string host;
    std::string port;
};

class statusServer_rpc:public SingleClass<statusServer_rpc>{

public:

message::resGetChatServerAddress* get_chatServer_address(std::string email);  //真正发送请求


private:
    friend class SingleClass<statusServer_rpc>;

    //这里完成一些进行rpc调用的必要操作--目前也就用一个stub去供多个可能的线程发起rpc调用
    std::string endpoint;   //对端地址
    std::shared_ptr<grpc::Channel> _channel;
    std::unique_ptr<message::statusServer::Stub> _stub;
    //客户端的创建相对简单
    statusServer_rpc();


};


#endif
